
"""
with : 上下文管理协议 目的:自动的帮我们释放资源

"""
with open("test.txt","r",encoding="utf-8") as file:
    s=file.read()
# print(s)

#给我写一个xml文件
with open("test.xml","w",encoding="utf-8") as file:
    file.write("<xml>")
    file.write("<name>张三</name>")
    file.write("</xml>")
    file.write("<xml>")
    file.write("<name>张三</name>")
    file.write("</xml>")




